/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-03-16
 * Time: 14:22
 */


public class Test {
    public static void main(String[] args) {
        System.out.println(fun(20));
    }

    public static long fun(long n){
        long index=0;
        for (long i = 1; i <=n ; i++) {
            long count=1;
            for (int j = 1; j <=i ; j++) {
                count=count*j;
            }
            index+=count;

        }
        return index;
    }
}
